<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style></style>
    <script>

        // onload = function(){
        //     var box = document.querySelector(".box");
        //     console.log(box);
        // }
        
    </script>    
</head>
<body>
    <div class="box"></div>
    <img src="./1.jpg" alt="" class="img">
    <input type="text" placeholder="">
</body>
<script>
    var img = document.querySelector(".img");

    console.log(img);

    onload = function(){
        console.log(img.offsetWidth);
    }



    onscroll = function(){
        console.log( document.documentElement.scrollLeft );
        console.log( document.documentElement.scrollTop );
    }



    onresize = function(){
        console.log( document.documentElement.clientWidth )
        console.log( document.documentElement.clientHeight )
    }

</script>
</html>